<extend name="Public:main" />
<block name="main-content">
<style type="text/css">
        .form-horizontal{
            margin-left: 280px;
            margin-top: 40px;
        }
        .anniu{
            margin-top: 40px;
            margin-left: 270px;
        }
        header{
            width: 1150px;
            text-align: center;
        }
        .left-line, .right-line{
            width: 350px;
            border:.5px solid #555555;
            display: inline-block;
            position: relative;
            bottom: 8px;
        }
		.uploadify-button {
		    position: relative;
		    text-align: center;
		    color: #fff;
		    cursor: pointer;
		    background-color: #0b7ebf;
		}
		.uploadify-queue{
			display:none;
			z-index:99999;
		}
    </style>
<header>
    <!-- 左横线  -->
    <div class="left-line"></div>
    <h1 style="display: inline; margin:0 60px;font-family: 'microsoft yahei'; font-weight: bold;" > 网站设置</h1>
    <!-- 右横线 -->
    <div class="right-line"></div>
</header>

<form class="form-horizontal" action="{:U('update')}" method="post" role="form" enctype="multipart/form-data">
    <div class="form-group">
        <label for="firstname" class="col-sm-2 control-label">网站名称</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="title" name="title" value="{$web_config_list.title|default=''}" style="width:270px;">
        </div>
    </div>
    <div class="form-group">
        <label for="lastname" class="col-sm-2 control-label">网站副标题</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="subtitle" name="subtitle" value="{$web_config_list.subtitle|default=''}" style="width:270px;">
        </div>
    </div>

    <div class="form-group">
        <label for="logo" class="col-sm-2 control-label">Logo</label>
		<div class="col-sm-4">
		<input type="text" id="logo_url" name="logo_url" value="{$web_config_list.logo_url|default=''}" class="form-control" style="width:270px;"  />	
		</div>							
        <div class="col-sm-6">
            <input type="file" id="upload_picture">
			<script type="text/javascript">
				//上传图片
			    /* 初始化上传插件 */
				$("#upload_picture").uploadify({
			        "height"          : 30,
			        "swf"             : "__STATIC__/uploadify/uploadify.swf",
			        "fileObjName"     : "download",
			        "buttonText"      : "上传图片",
			        "uploader"        : "{:U('upload',array('session_id'=>session_id()))}",
			        "width"           : 120,
			        'removeTimeout'	  : 1,
			        'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
			        "onUploadSuccess" : uploadPicture,
			        'onFallback' : function() {
			            alert('未检测到兼容版本的Flash.');
			        }
			    });
				function uploadPicture(file, data){
			    	var data = $.parseJSON(data);
			    	var src = '';
			        if(data.status){
			        	src = data.url || '__ROOT__' + data.path;
						$("#logo_url").attr('value', src);
						$(".upload-img-box").html(
		        			'<div class="upload-pre-item"><img src="' + src + '"/></div>'
		        		);
			        } else {
						return false;
			        }
			    }
			</script>		
        </div>
    </div>
    <div class="form-group">
        <label for="icp" class="col-sm-2 control-label">ICP备案号</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="icp" name="icp" value="{$web_config_list.icp|default=''}" style="width:270px;">
        </div>
    </div>
    <div class="form-group">
        <label for="icp" class="col-sm-2 control-label">URL模式</label>
        <div class="col-sm-10">
            <div class="radio">
                <label>
                    <input type="radio" name="url_model" id="url_model" value="1" <if condition="$web_config_list.url_model eq 1">checked</if>>查询式，形如：http://eduwind.com/index.php?r=course/view&id=12
                </label>
            </div>
            <div class="radio">
                <label>
                    <input type="radio" name="url_model" id="url_model" value="2" <if condition="$web_config_list.url_model eq 2">checked</if>>路径式，形如：http://eduwind.com/course/12(注意，需要开启伪静态！)
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label for="icp" class="col-sm-2 control-label">站点统计代码</label>
        <div class="col-sm-10">
            <textarea class="form-control" rows="3" name="web_code_count" style="width:300px;">{$web_config_list.web_code_count|default=''}</textarea>
        </div>
    </div>
    <div class="anniu">
    	<input type="hidden" name="id" value="{$web_config_list.id|default=''}">
        <button class="btn btn-primary"  type="submit" id="submit" target-form="form-horizontal">提交</button>
</form>
</block>